/**
 * 卡转卡 	kzk
支付宝UID大额 	alipayUid
支付宝uid小额 	alipayUidSmall
支付宝小荷包 	alipaySmallPurse
支付宝UID转账 	alipayUidTransfer
微信群红包 	wechatGroupRed
支付宝口令红包 	alipayPassRed
支付宝零花钱 	alipayPinMoney
支付宝扫码 	alipayCode
数字人民币 	CnyNumber
抖音群红包 	douyinGroupRed
微信扫码 	wechatCode
小程序商品码 	AppletProducts
QQ面对面红包 	QQFaceRed
支付宝扫码超级大额 	taoBaoMoneyRed
支付宝转账码 	alipayTransferCode
支付宝工作证 	alipayWorkCard
数字人民币自动 	CnyNumberAuto
支付宝扫码中额通道 	QianxinTransfer
淘宝E卡 	taoBaoEcard
小额支付宝扫码 	alipayCodeSmall
聚合码 	AggregateCode
支付宝当面付 	alipayF2F
支付宝手机网站 	alipayWap
支付宝个人转账 	alipayTransfer
淘宝直付 	taoBaoDirectPay
钉钉群收款 	DingDingGroup
微信黄金红包 	WechatGoldRed
QQ扫码 	QqCode
亲情卡 	KinshipCard
代付 	daifu
QQ转账 	qqTransfer
QQ转账 	qqTransfer
支付宝红包 	alipayRedPacket
IM支付 	imPay
支付宝AA 	alipayAAPacket
支付宝小钱袋 	alipaySmMoney
淘宝代付 	taobaoDaiFu
翼支付 	yiPay
淘宝直付自动 	taobaoDirectPayAuto
神州行 	easyOwn
支付宝综合 	alipayZongHe
支付宝综合2 	alipayZongHeTwo
数字人民币2 	CnyNumberTwo
微信好友转账 	WeChatFriendTransFer
淘宝零钱花 	taoBaoPocketMoney
支付宝转卡 	alipayCard
支付宝固额 	alipayAAPacketBig
支付宝AA中额 	alipayAAPacketModdle
支付宝UID红包 	alipayUidRed
支付宝资金周转 	alipayCashFlow
支付宝小钱袋2 	alipaySmMoneyTwo
云闪付转账 	cloudTransfer
云闪付转账红包 	cloudTransferRed
QQ群红包 	qqGroupRed
支付宝转卡自动 	alipayCardAuto
银联扫码 	bankCode
支付宝扫码红包 	alipayCodeRed
支付宝小荷包v2 	alipaySmallPurseVt
支付宝淘宝 	alipayTaoBao
云闪付扫码 	cloudCode
闲鱼代付大额 	xianyuDaiFuBig
闲鱼代付小额 	xianyuDaiFuSmall
支付宝收款单 	alipayReceipt
支付宝小荷包v3 	alipaySmallPurseVs
支付宝转账自动 	alipayTransferAuto
卡转卡大额 	kzkBig
小额支付宝口令红包 	alipayPassRedSmall
微信赞赏码 	weChatAppCode
大额支付宝扫码 	alipayCodeBig
数字银联 	numberBank
超大额支付宝UiD转账 	alipayUidTransferBig
超级大额支付宝扫码v2 	alipayCodeBigVt
支付宝批量转账 	alipayBatchTransfer
超大额批量转账 	alipayBatchTransferBig
微信群红包V2 	wechatGroupRedVt
支付宝马来通道 	alipayForeignCurrency
小额IM支付 	imPaySmall
数字人民币扫码 	cnyNumberCode
银联扫码v2 	bankCodeVt
电子回单 	electronicReply
支付宝充值卡 	alipayRechCard
外币版支付宝 	alipayForeignCurrencyVt
数字人民币专属红包 	CnyNumberRed
 */
// qr_code_total 二维码总数
const baseConfig: { [key: string]: any } = {
  other: {
    channel: {
      search: [
        // { key: 'pro_id', label: '收款渠道', type: 'select-v2', },
        // { key: 'account_name', label: '账户名', },
        { key: 'ms_id', label: '码商用户名', type: 'select-v2', },
        { key: 'status', label: '收款码状态', type: 'select', },
        // { key: 'is_delete', label: '删除状态', type: 'select', },
      ],
      table: [
        { key: 'id', label: '收款码ID', width: 100, },
        { key: 'ms_name', label: '码商用户名', },
        { key: 'pay_info', label: '收款码信息', width: 380, },
        { key: 'pro_nameCom', label: '渠道', width: 320, },
        { key: 'qr_code', label: '二维码', type: 'slot', width: 140 },
        { key: 'status', label: '状态', type: 'slot', width: 100 },
        { key: 'daily_limit_amount', label: '每日额度限制', },
        { key: 'daily_limit_amount', label: '每日笔数限制', },
        { key: 'rate', label: '费率（%）', width: 140, },
        // { key: 'account_name', label: '收款人', },
        // { key: 'account_number', label: '收款账号', },
        // { key: 'bank_name', label: '收款银行', },
        // { key: 'appid', label: 'appid', },
        // { key: 'limit_num', label: '笔数限制', },
        // { key: 'success_amount', label: '成功金额', },
        // { key: 'jd_amount', label: '进单金额', },
        // { key: 'min_amount', label: '最小请求金额', },
        // { key: 'max_amount', label: '最大请求金额', },
        // { key: 'fixed_amount', label: '固定金额', },
        // { key: 'is_deleteCom', label: '是否删除' },
        // { key: 'createtimeCom', label: '添加时间', },
      ],
    },
    order: {
      search: [
        { key: 'pro_id', label: '支付渠道', type: 'select-v2', },
        { key: 'ms_id', label: '码商用户名', type: 'select-v2', },
        { key: 'mer_order_sn', label: '商户单号', },
        { key: 'return_status', label: '通知状态', type: 'select', },
        { key: 'ip', label: 'ip', },
        { key: 'start_create_time', label: '开始创建时间', type: 'date-picker', },
        { key: 'end_create_time', label: '结束创建时间', type: 'date-picker', },
        { key: 'start_update_time', label: '开始修改时间', type: 'date-picker', },
        { key: 'end_update_time', label: '结束修改时间', type: 'date-picker', },
        { key: 'status', label: '订单状态', type: 'select', },
        { key: 'dl_ms_id', label: '代理码商id', type: 'select-v2', },
      ],
      table: [
        { key: 'id', label: 'ID', },
        { key: 'ms_name', label: '码商用户名', },
        { key: 'mer_name', label: '商户名', },
        { key: 'mer_order_sn', label: '商户订单号', },
        // { key: 'ms_id', label: '码商id', },
        // { key: 'pay_product_id', label: '支付产品id', },
        // { key: 'ms_pay_product_detail_id', label: '码商通道id', },
        // { key: 'mer_id', label: '商户id', },
        { key: 'order_sn', label: '平台订单号', },
        { key: 'amount', label: '金额', },
        { key: 'service_fee', label: '手续费', },
        { key: 'real_amount', label: '实际到账金额', },
        { key: 'notify_url', label: '异步通知地址', },
        { key: 'return_url', label: '同步通知地址', },
        { key: 'statusCom', label: '订单状态', },
        { key: 'incomeAmountCom', label: '收入金额', },
        { key: 'return_statusCom', label: '通知状态', },
        { key: 'time_stampCom', label: '接口调用时间戳', },
        { key: 'ip', label: 'ip', },
        { key: 'device_typeCom', label: '设备类型', },
        { key: 'device_info', label: '设备信息', },
        // { key: 'dl_ms_id', label: '代理码商id', },
        { key: 'dl_profit', label: '代理分佣金额', },
        { key: 'createtimeCom', label: '创建时间戳', },
        { key: 'updatetimeCom', label: '修改时间戳', },
        { key: 'is_deleteCom', label: '是否删除', },
        // { key: 'orderStatusRecord', label: '添加时间', },
        // { key: 'payInfo', label: '添加时间', },
      ],
    },
  },
  payer: {
  },
  payee: {
    channel: {
      search: [
        { key: 'id', label: '支付渠道', type: 'select-v2', },
        { key: 'account_name', label: '账户名称', },
        { key: 'account_number', label: '账号', },
        { key: 'status', label: '状态', type: 'select', },
        // { key: 'is_delete', label: '删除状态', type: 'select', },
      ],
      table: [
        { key: 'pro_nameCom', label: '渠道', minWidth: 320, },
        { key: 'account_name', label: '账号名称', },
        { key: 'account_number', label: '账号', },
        { key: 'bank_name', label: '收款银行', },
        { key: 'qr_code', label: '二维码', type: 'slot' },
        { key: 'status', label: '状态', type: 'slot' },
        { key: 'daily_limit_amount', label: '每日限额', },
        { key: 'limit_num', label: '笔数限制', },
        { key: 'rate', label: '费率（%）', },
        // { key: 'fixed_amount', label: '固定金额', },
        // { key: 'limit_num', label: '金额限制类型', },
        // { key: 'max_amount', label: '最大金额', },
        // { key: 'min_amount', label: '最小金额', },
        // { key: 'fixed_amount', label: '固定金额', },
        // { key: 'pass_code', label: '渠道编码', },
      ],
      add: {
        common: [
          // {
          //   key: "account_name",
          //   type: "input",
          //   formAttrs: {
          //     label: "账号名称 "
          //   },
          //   controlAttrs: {
          //     placeholder: '请填写账号名称',
          //     clearable: true,
          //   },
          // },
          // {
          //   "key": "account_number",
          //   "type": "input",
          //   formAttrs: {
          //     label: "账号",
          //   },
          //   controlAttrs: {
          //     placeholder: '请填写账号',
          //     clearable: true,
          //   },
          // },
          // {
          //   "key": "qr_code",
          //   "type": "upload-img",
          //   formAttrs: {
          //     label: "二维码"
          //   },
          //   controlAttrs: {
          //     placeholder: '请填写图片地址',
          //     clearable: true,
          //   },
          // },
          // {
          //   "key": "remarks",
          //   "type": "input",
          //   formAttrs: {
          //     label: "备注信息"
          //   },
          //   controlAttrs: {
          //     placeholder: '请填写备注信息',
          //     clearable: true,
          //   },
          // },
          {
            "key": "min_amount",
            "type": "input-number",
            formAttrs: {
              label: "最小金额"
            },
            controlAttrs: {
              placeholder: '请填写最小金额',
              clearable: true,
              min: 0,
              style: {
                width: '100%',
              },
            },
            hidden: true,
          },
          {
            "key": "max_amount",
            "type": "input-number",
            formAttrs: {
              label: "最大金额"
            },
            controlAttrs: {
              placeholder: '请填写最大金额',
              clearable: true,
              min: 0,
              style: {
                width: '100%',
              },
            },
            hidden: true,
          },
          {
            "key": "fixed_amount",
            "type": "input-number",
            formAttrs: {
              label: "固定值"
            },
            controlAttrs: {
              placeholder: '请填写固定值',
              clearable: true,
              min: 0,
              style: {
                width: '100%',
              },
            },
            hidden: true,
          },
          {
            "key": "daily_limit_amount",
            "type": "input-number",
            formAttrs: {
              label: "每日限制金额",
            },
            controlAttrs: {
              placeholder: '请填写每日限制金额',
              clearable: true,
              min: 0,
              style: {
                width: '100%',
              },
            },
            hidden: true,
          },
          {
            "key": "limit_num",
            "type": "input-number",
            formAttrs: {
              label: "笔数限制"
            },
            controlAttrs: {
              placeholder: '请填写笔数限制',
              clearable: true,
              min: 0,
              style: {
                width: '100%',
              },
            },
            hidden: true,
          },
        ],
        // 数字人民币
        CnyNumber: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "收款人姓名 "
            },
            controlAttrs: {
              placeholder: '请填写收款人姓名',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "钱包编号",
            },
            controlAttrs: {
              placeholder: '请填写钱包编号',
              clearable: true,
            },
          },
        ],
        // 卡转卡
        kzk: [
          {
            key: "bank_name",
            type: "select-v2",
            formAttrs: {
              label: "银行信息 "
            },
            controlAttrs: {
              placeholder: '请选择银行信息',
              clearable: true,
              filterable: true,
            },
          },
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "账号名称 "
            },
            controlAttrs: {
              placeholder: '请填写账号名称',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "开户卡号",
            },
            controlAttrs: {
              placeholder: '请填写开户卡号',
              clearable: true,
            },
          },],
        // QQ扫码
        QqCode: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "QQ昵称 "
            },
            controlAttrs: {
              placeholder: '请填写QQ昵称',
              clearable: true,
            },
          },
          {
            key: "account_number",
            type: "input",
            formAttrs: {
              label: "QQ账号 "
            },
            controlAttrs: {
              placeholder: '请填写QQ账号',
              clearable: true,
            },
          },
          {
            "key": "qr_code",
            "type": "upload-img",
            formAttrs: {
              label: "二维码"
            },
          },
        ],
        // 云闪付转账红包
        cloudTransferRed: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "收款人姓名 "
            },
            controlAttrs: {
              placeholder: '请填写收款人姓名',
              clearable: true,
            },
          },
          {
            "key": "phone",
            "type": "input",
            formAttrs: {
              label: "收款人手机号",
            },
            controlAttrs: {
              placeholder: '请填写收款人手机号',
              clearable: true,
            },
          },
        ],
        // 支付宝个人转账
        alipayTransfer: [
          {
            key: "real_name",
            type: "input",
            formAttrs: {
              label: "支付宝姓名"
            },
            controlAttrs: {
              placeholder: '请填写支付宝姓名',
              clearable: true,
            },
          },
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "支付宝昵称"
            },
            controlAttrs: {
              placeholder: '请填写支付宝昵称',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "支付宝账号",
            },
            controlAttrs: {
              placeholder: '请填写支付宝账号',
              clearable: true,
            },
          },
        ],
        // 小额支付宝扫码
        alipayCodeSmall: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "收款人姓名 "
            },
            controlAttrs: {
              placeholder: '请填写收款人姓名',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "收款人账号",
            },
            controlAttrs: {
              placeholder: '请填写收款人账号',
              clearable: true,
            },
          },
          {
            "key": "qr_code",
            "type": "upload-img",
            formAttrs: {
              label: "二维码"
            },
          },],
        // 微信群红包
        wechatGroupRed: [

          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "微信群名称 "
            },
            controlAttrs: {
              placeholder: '请填写微信群名称',
              clearable: true,
            },
          },
          {
            "key": "qr_code",
            "type": "upload-img",
            formAttrs: {
              label: "群二维码"
            },
          },
        ],
        // 中额支付宝扫码
        alipayModdleCode: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "收款人姓名 "
            },
            controlAttrs: {
              placeholder: '请填写收款人姓名',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "收款人账号",
            },
            controlAttrs: {
              placeholder: '请填写收款人账号',
              clearable: true,
            },
          },
          {
            "key": "qr_code",
            "type": "upload-img",
            formAttrs: {
              label: "二维码"
            },
          },],
        // 支付宝扫码
        alipayCode: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "收款人姓名 "
            },
            controlAttrs: {
              placeholder: '请填写收款人姓名',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "收款人账号",
            },
            controlAttrs: {
              placeholder: '请填写收款人账号',
              clearable: true,
            },
          },
          {
            "key": "qr_code",
            "type": "upload-img",
            formAttrs: {
              label: "收款码"
            },
          },
        ],
        // 支付宝当面付
        alipayF2FPay: [
          {
            "key": "app_id",
            "type": "input",
            formAttrs: {
              label: "应用ID",
            },
            controlAttrs: {
              placeholder: '请填写应用ID',
              clearable: true,
            },
          },
          {
            key: "alipay_public_key",
            type: "input",
            formAttrs: {
              label: "支付宝公钥 "
            },
            controlAttrs: {
              placeholder: '请填写支付宝公钥',
              clearable: true,
              type: "textarea",
            },
          },
          {
            "key": "merchant_private_key",
            "type": "input",
            formAttrs: {
              label: "商户私钥",
            },
            controlAttrs: {
              placeholder: '请填写商户私钥',
              clearable: true,
              type: "textarea",
            },
          },
        ],
        // 微信扫码
        wechatCode: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "微信昵称 "
            },
            controlAttrs: {
              placeholder: '请填写微信昵称',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "微信账号",
            },
            controlAttrs: {
              placeholder: '请填写微信账号',
              clearable: true,
            },
          },
          {
            "key": "qr_code",
            "type": "upload-img",
            formAttrs: {
              label: "收款码"
            },
          },
        ],
        // 支付宝口令红包
        alipayPassRed: [
          {
            key: "real_name",
            type: "input",
            formAttrs: {
              label: "支付宝姓名"
            },
            controlAttrs: {
              placeholder: '请填写支付宝姓名',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "支付宝账号",
            },
            controlAttrs: {
              placeholder: '请填写支付宝账号',
              clearable: true,
            },
          },
        ],
        // 支付宝转账码
        alipayTransferCode: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "支付宝昵称"
            },
            controlAttrs: {
              placeholder: '请填写支付宝昵称',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "支付宝账号",
            },
            controlAttrs: {
              placeholder: '请填写支付宝账号',
              clearable: true,
            },
          },
        ],
        // 银联H5支付
        bankPayH5: [
          {
            key: "account_name",
            type: "input",
            formAttrs: {
              label: "收款人姓名 "
            },
            controlAttrs: {
              placeholder: '请填写收款人姓名',
              clearable: true,
            },
          },
          {
            "key": "account_number",
            "type": "input",
            formAttrs: {
              label: "钱包编号",
            },
            controlAttrs: {
              placeholder: '请填写钱包编号',
              clearable: true,
            },
          },
        ],
      },
      edit: [
        // {
        //   "key": "account_name",
        //   "type": "input",
        //   formAttrs: {
        //     label: "账号名称 "
        //   },
        //   controlAttrs: {
        //     placeholder: '请填写账号名称',
        //     clearable: true,
        //   },
        // },
        // {
        //   "key": "account_number",
        //   "type": "input",
        //   formAttrs: {
        //     label: "账号",
        //   },
        //   controlAttrs: {
        //     placeholder: '请填写账号',
        //     clearable: true,
        //   },
        // },
        // {
        //   "key": "qr_code",
        //   "type": "input",
        //   formAttrs: {
        //     label: "二维码"
        //   },
        //   controlAttrs: {
        //     placeholder: '请填写图片地址',
        //     clearable: true,
        //   },
        // },
        // {
        //   "key": "remarks",
        //   "type": "input",
        //   formAttrs: {
        //     label: "备注信息"
        //   },
        //   controlAttrs: {
        //     placeholder: '请填写备注信息',
        //     clearable: true,
        //   },
        // },
        // {
        //   "key": "fixed_amount",
        //   "type": "input-number",
        //   formAttrs: {
        //     label: "固定值"
        //   },
        //   controlAttrs: {
        //     placeholder: '请填写固定值',
        //     clearable: true,
        //     min: 0,
        //     style: {
        //       width: '100%',
        //     },
        //   },
        // },
        {
          "key": "daily_limit_amount",
          "type": "input-number",
          formAttrs: {
            label: "每日限制金额",
          },
          controlAttrs: {
            placeholder: '请填写每日限制金额',
            clearable: true,
            min: 0,
            style: {
              width: '100%',
            },
          },
        },
        {
          "key": "limit_num",
          "type": "input-number",
          formAttrs: {
            label: "笔数限制"
          },
          controlAttrs: {
            placeholder: '请填写笔数限制',
            clearable: true,
            min: 0,
            style: {
              width: '100%',
            },
          },
        },
      ],
    },
    order: {
      search: [
        // 商户订单号   收款人账户名 收款人账号  支付渠道  订单状态    (按订单发起时间:开始时间 结束时间) 
        { key: 'pay_product_id', label: '支付渠道', type: 'select-v2', },
        { key: 'mer_order_sn', label: '商户订单号', },
        { key: 'account_name', label: '收款人账户名', },
        { key: 'account_number', label: '收款人账号', },
        { key: 'status', label: '订单状态', type: 'select', },
        { key: 'start_time', label: '开始时间', type: 'date-picker', },
        { key: 'end_time', label: '结束时间', type: 'date-picker', },
      ],
      table: [
        // 商户订单号  (api发起订单号)
        // 订单金额   (api发起支付金额)
        // 订单手续费 (码商佣金收入)
        // 支付金额 （用户实际,如果有浮动，金额会与拉单金额不符合）
        // 支付渠道（显示渠道名字 ）
        // 订单状态（成功,未支付）   
        // 付款人姓名
        // 收款人账户名
        // 收款人账号
        // 订单创建时间
        // 订单成功时间
        { key: 'pro_nameCom', label: '支付渠道', },
        { key: 'mer_order_sn', label: '商户订单号', },
        { key: 'amount', label: '订单金额', },
        // { key: 'service_fee', label: '订单手续费', },
        { key: 'ms_profit', label: '订单手续费', },    //码商利润
        // { key: 'order_sn', label: '平台订单号', },
        { key: 'real_amount', label: '支付金额', },
        { label: "订单状态", key: "statusCom", width: 200, type: "slot" },
        { label: "付款信息", key: "payment_infoCom", width: 280, type: "slot" },
        { label: "查看凭证时间", key: "viewing_timeCom", width: 200 },
        // { key: 'return_statusCom', label: '通知状态', type: 'tag', },
        // { key: 'payer_name', label: '付款人姓名', },
        { key: 'account_name', label: '收款人账号名', },
        { key: 'account_number', label: '收款人账号', },
        { key: 'orderPayNumsCom', label: '口令', },
        { key: 'createtimeCom', label: '订单创建时间', },
        { key: 'updatetimeCom', label: '订单成功时间', },
        // { key: 'qr_code', label: '二维码', type: 'slot', },
        // { key: 'remarks', label: '账号备注', },
      ],
    },
  },
};

import { useUserStore } from "@/store";

// 导出一个函数，用于获取配置
export default function getConfig(page: string, key: string) {
  // 从localStorage中获取登录类型
  const loginType: string = useUserStore().getLoginType();
  // 定义一个变量，用于存储结果
  let result = baseConfig[loginType][page];

  // 遍历结果中的每一个对象
  Object.keys(result).map(k => {
    // 定义一个变量，用于存储单个对象
    let singleItem = result[k];

    // 如果key等于alipayUid
    if (key === 'alipayUid') {
      // 定义一个变量，用于存储表格
      let table: Array<any> = singleItem.table;
      // 查找表格中key为appid的索引
      const index = table.findIndex(item => item.key === 'appid');
      // 将表格中key为appid的项的noDisable设置为true
      table[index].noDisable = true;
    }
  });

  // 返回结果
  return result;
}
